package com.bruce.ai.alibaba.common.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Nacos 配置属性类
 * 统一管理所有 Nacos 相关的配置项
 */
@Component
@ConfigurationProperties(prefix = "nacos")
public class NacosProperties {

    /**
     * Nacos 服务器地址
     */
    private String serverAddr = "localhost:8848";

    /**
     * Nacos 命名空间
     */
    private String namespace = "dev";

    /**
     * Nacos 用户名
     */
    private String username = "nacos";

    /**
     * Nacos 密码
     */
    private String password = "nacos";

    // Getter 和 Setter 方法

    public String getServerAddr() {
        return serverAddr;
    }

    public void setServerAddr(String serverAddr) {
        this.serverAddr = serverAddr;
    }

    public String getNamespace() {
        return namespace;
    }

    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "NacosProperties{" +
                "serverAddr='" + serverAddr + '\'' +
                ", namespace='" + namespace + '\'' +
                ", username='" + username + '\'' +
                ", password='[PROTECTED]'" +
                '}';
    }
}